#define _CRT_SECURE_NO_WARNINGS 1
#include"slist.h"
void test01()
{
	slnode* node1 = (slnode*)malloc(sizeof(slnode));
	node1->data = 1;

	slnode* node2 = (slnode*)malloc(sizeof(slnode));
	node2->data = 2;

	slnode* node3 = (slnode*)malloc(sizeof(slnode));
	node3->data = 3;

	slnode* node4 = (slnode*)malloc(sizeof(slnode));
	node4->data = 4;

	node1->next = node2;
	node2->next = node3;
	node3->next = node4;
	node4->next = NULL;

	slnode* plist = node1;
	slprint(plist);
}

void test02()
{
	slnode* slist = NULL;
	slpushback(&slist, 1);
	slpushback(&slist, 2);
	slpushback(&slist, 3);
	slpushback(&slist, 4);
	slprint(slist);

	slpushfront(&slist, 8);
	slpushfront(&slist, 9);
	slprint(slist);

	slpopback(&slist);
	slprint(slist);
	slpopback(&slist);
	slprint(slist);

	slpopfront(&slist);
	slprint(slist);
}

int main()
{
	test02();
	return 0;
}